package com.binvshe.binvshe.message;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.binvshe.binvshe.R;
import com.binvshe.binvshe.message.fragment.LikeMessageFragment;
import com.binvshe.binvshe.message.fragment.OtherMessageFragment;
import com.binvshe.binvshe.message.fragment.ReplyMessageFragment;
import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

import butterknife.Bind;

public class MessageNoticeActivity extends BaseActivity {

    @Bind(R.id.mVptabMessage)
    SmartTabLayout mVptabMessage;
    @Bind(R.id.mVpMessage)
    ViewPager mVpMessage;

    public static void start(Context context) {
        Intent starter = new Intent(context, MessageNoticeActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initToolBar();
    }

    private void initToolBar() {
        setTitle("消息通知");
        enableBackButton();
        FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(getSupportFragmentManager(), FragmentPagerItems.with(this)
                .add("回复", ReplyMessageFragment.class)
                .add("点赞", LikeMessageFragment.class)
                .add("其他消息", OtherMessageFragment.class)
                .create());
        mVpMessage.setAdapter(adapter);
        mVptabMessage.setViewPager(mVpMessage);
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.act_message_notice, null);
    }
}
